FROM centos:centos7
MAINTAINER tian.dong <tiandong19860806@126.com>

#                        install jdk                                              

RUN mkdir -p /opt/install/jdk
COPY soft/jdk-8u212-linux-x64.tar.gz  /opt/install/
RUN \
    tar -zxf /opt/install/jdk-8u212-linux-x64.tar.gz -C /opt/install/ && \
    mv /opt/install/jdk1.8.0_212/* /opt/install/jdk/ && \
    rm -rf /opt/install/jdk1.8.0_212 && \
	rm -rf /opt/install/jdk-8u212-linux-x64.tar.gz
ENV JAVA_HOME /opt/install/jdk
ENV CLASS_PATH $CLASS_PATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
ENV PATH $PATH:$JAVA_HOME/bin
	
#                        install nexus                                              

# step 1: make directory
RUN mkdir -p /opt/install
COPY soft/nexus-3.20.1-01-unix.tar.gz /opt/install/
COPY soft/nexus.sh /opt/install/

# step 2: set enviroment
ENV SONATYPE_APP_ROOT /nfs_data/app/infra-system/nexus-single
ENV SONATYPE_DATA_ROOT /nfs_data/data/infra-system/nexus-single 
ENV NEXUS_HOME $SONATYPE_APP_ROOT/nexus 
ENV SONATYPE_WORK $SONATYPE_DATA_ROOT/sonatype-work 
ENV NEXUS_DATA $SONATYPE_DATA_ROOT/nexus-data 
ENV NEXUS_CONTEXT '' 
ENV INSTALL4J_ADD_VM_PARAMS "-Xms=256m -Xmx=256m -XX:MaxDirectMemorySize=512m -Djava.util.prefs.userRoot $NEXUS_DATA/javaprefs" 
ENV PATH $PATH:$NEXUS_HOME/bin 
# set nfs mapping path, also can set it in the file of deployment.
VOLUME ["$SONATYPE_APP_ROOT", "$SONATYPE_DATA_ROOT"] 